import request from '@/utils/request'
//查询用户列表
export const getUserList = data =>
  request({
    url: '/admin/system/sysUser/userList',
    method: 'post',
    data,
  })
//添加用户
export const addUser = data => {
  return request({
    url: '/admin/system/sysUser/add',
    method: 'post',
    data: data,
  })
}
//修改用户
export const editUser = data => {
  return request({
    url: '/admin/system/sysUser/edit',
    method: 'put',
    data: data,
  })
}
//删除用户
export const deleteUser = id => {
  return request({
    url: `/admin/system/sysUser/delete/${id}`,
    method: 'delete',
  })
}
//给用户分配角色
export const assignRole = data => {
  return request({
    url: '/admin/system/sysUser/assignRole',
    method: 'post',
    data: data,
  })
}
//查询用户绑定的角色id列表
export const getRoleIds = id => {
  return request({
    url: `/admin/system/sysUser/roleIdList/${id}`,
    method: 'get',
  })
}
